﻿<ResourceDictionary 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:Controls="clr-namespace:PSE.Deployment.ConfigurationManager.Controls;assembly=PSE.Deployment.ConfigurationManager.Controls"
	mc:Ignorable="d">
	<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
		<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
			<Grid>
				<Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}" BorderStyle="Sunken" BorderThickness="2">
					<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Focusable="False">
						<Microsoft_Windows_Themes:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=Border}" x:Name="Shdw" Color="Transparent">
							<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
								<ScrollViewer>
									<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
								</ScrollViewer>
							</Border>
						</Microsoft_Windows_Themes:SystemDropShadowChrome>
					</Popup>
				</Microsoft_Windows_Themes:ClassicBorderDecorator>
				<ToggleButton Margin="2" MinHeight="0" MinWidth="0" Style="{DynamicResource ComboBoxTransparentButtonStyle}" Width="Auto" Focusable="false" ClickMode="Press" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
				<DockPanel Margin="2">
					<FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right"/>
					<TextBox Margin="{TemplateBinding Padding}" x:Name="PART_EditableTextBox" Style="{DynamicResource ComboBoxEditableTextBox}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsReadOnly="{Binding Path=IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"/>
				</DockPanel>
			</Grid>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="HasItems" Value="false">
				<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
			</Trigger>
			<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
				<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
				<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
			</Trigger>
			<Trigger Property="IsGrouping" Value="true">
				<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Style x:Key="ComboBoxFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="4,4,21,4" SnapsToDevicePixels="true"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ComboBoxTransparentButtonStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="Width" Value="Auto"/>
		<Setter Property="Height" Value="Auto"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"/>
		<Setter Property="BorderThickness" Value="2"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<DockPanel SnapsToDevicePixels="true" Background="{TemplateBinding Background}" LastChildFill="false">
						<Border x:Name="Border" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right" Background="#FFE8E8E8" BorderThickness="1,1,1,1" BorderBrush="#FF999999">
							<Path Fill="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{DynamicResource DownArrowGeometry}"/>
						</Border>
					</DockPanel>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<!-- <Setter Property="BorderStyle" TargetName="Border" Value="AltPressed"/> -->
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
			</Trigger>
		</Style.Triggers>
	</Style>
	<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="AllowDrop" Value="true"/>
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ComboBoxPSE" TargetType="{x:Type ComboBox}">
		<Setter Property="FocusVisualStyle" Value="{DynamicResource ComboBoxFocusVisual}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="Margin" Value="0,0,0,0"/>
		<Setter Property="Padding" Value="2,1"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ComboBox}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
						<Grid>
							<Border x:Name="Border" BorderBrush="#FF999999" BorderThickness="1,1,1,1" Background="#FFE8E8E8">
								<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Focusable="False">
									<Microsoft_Windows_Themes:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=Border}" x:Name="Shdw" Color="Transparent">
										<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
											<ScrollViewer>
												<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
											</ScrollViewer>
										</Border>
									</Microsoft_Windows_Themes:SystemDropShadowChrome>
								</Popup>
							</Border>
							<DockPanel Margin="2">
								<FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right"/>
								<Border Margin="{TemplateBinding Padding}" x:Name="SelectedItemBorder">
									<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,1,1,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
								</Border>
							</DockPanel>
							<ToggleButton Margin="2" MinHeight="0" MinWidth="0" Style="{DynamicResource ComboBoxTransparentButtonStyle}" Width="Auto" Focusable="false" ClickMode="Press" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelectionBoxHighlighted" Value="true"/>
								<Condition Property="IsDropDownOpen" Value="false"/>
							</MultiTrigger.Conditions>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsSelectionBoxHighlighted" Value="true">
							<Setter Property="Background" TargetName="SelectedItemBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
						</Trigger>
						<Trigger Property="HasItems" Value="false">
							<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
						<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
							<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
							<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<Trigger Property="IsEditable" Value="true">
				<Setter Property="IsTabStop" Value="false"/>
				<Setter Property="Padding" Value="1"/>
				<Setter Property="Template" Value="{DynamicResource ComboBoxEditableTemplate}"/>
			</Trigger>
		</Style.Triggers>
	</Style>

	<!-- INI CONFIGURATION MANAGER -->
	<Style x:Key="ConfigurationSimpleTextBoxStyle" TargetType="{x:Type Controls:SimpleComboBox}">
		<Setter Property="FocusVisualStyle" Value="{DynamicResource ComboBoxFocusVisual}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="Margin" Value="0,0,0,0"/>
		<Setter Property="Padding" Value="2,1"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Margin" Value="4,0,0,0"/>
		<Setter Property="Width" Value="300"/>
		<Setter Property="Height" Value="21"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Controls:SimpleComboBox}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
						<Grid>
							<Border x:Name="Border" BorderBrush="#FF999999" BorderThickness="1,1,1,1" Background="#FFE8E8E8">
								<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Focusable="False">
									<Microsoft_Windows_Themes:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=Border}" x:Name="Shdw" Color="Transparent">
										<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
											<ScrollViewer>
												<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
											</ScrollViewer>
										</Border>
									</Microsoft_Windows_Themes:SystemDropShadowChrome>
								</Popup>
							</Border>
							<DockPanel Margin="2">
								<FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right"/>
								<Border Margin="{TemplateBinding Padding}" x:Name="SelectedItemBorder">
									<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,1,1,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
								</Border>
							</DockPanel>
							<ToggleButton Margin="2" MinHeight="0" MinWidth="0" Style="{DynamicResource ComboBoxTransparentButtonStyle}" Width="Auto" Focusable="false" ClickMode="Press" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelectionBoxHighlighted" Value="true"/>
								<Condition Property="IsDropDownOpen" Value="false"/>
							</MultiTrigger.Conditions>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsSelectionBoxHighlighted" Value="true">
							<Setter Property="Background" TargetName="SelectedItemBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
						</Trigger>
						<Trigger Property="HasItems" Value="false">
							<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
						<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
							<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
							<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ConfigurationErrorSimpleTextBoxStyle" TargetType="{x:Type Controls:SimpleComboBox}">
		<Setter Property="FocusVisualStyle" Value="{DynamicResource ComboBoxFocusVisual}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="Margin" Value="0,0,0,0"/>
		<Setter Property="Padding" Value="2,1"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Margin" Value="4,0,0,0"/>
		<Setter Property="Width" Value="300"/>
		<Setter Property="Height" Value="21"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Controls:SimpleComboBox}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
						<Grid>
							<Border x:Name="Border" BorderBrush="#FFFF0000" BorderThickness="2" Background="#FFE8E8E8">
								<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Focusable="False">
									<Microsoft_Windows_Themes:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=Border}" x:Name="Shdw" Color="Transparent">
										<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
											<ScrollViewer>
												<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
											</ScrollViewer>
										</Border>
									</Microsoft_Windows_Themes:SystemDropShadowChrome>
								</Popup>
							</Border>
							<DockPanel Margin="2">
								<FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right"/>
								<Border Margin="{TemplateBinding Padding}" x:Name="SelectedItemBorder">
									<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,1,1,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
								</Border>
							</DockPanel>
							<ToggleButton Margin="2" MinHeight="0" MinWidth="0" Style="{DynamicResource ComboBoxTransparentButtonStyle}" Width="Auto" Focusable="false" ClickMode="Press" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelectionBoxHighlighted" Value="true"/>
								<Condition Property="IsDropDownOpen" Value="false"/>
							</MultiTrigger.Conditions>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsSelectionBoxHighlighted" Value="true">
							<Setter Property="Background" TargetName="SelectedItemBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
						</Trigger>
						<Trigger Property="HasItems" Value="false">
							<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
						<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
							<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
							<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- FIM CONFIGURATION MANAGER -->
</ResourceDictionary>